package com.jakewharton.rxbinding4.component;

import static com.jakewharton.rxbinding4.internal.Preconditions.checkNotNull;

import io.reactivex.rxjava3.annotations.NonNull;
import io.reactivex.rxjava3.core.Observable;
import ohos.agp.components.TickTimer;

/**
 * Rx tick timer
 */
public class RxTickTimer {
    /**
     * Create an observable of editor actions on {@code view}.
     * <p>
     * <em>Warning:</em> The created observable keeps a strong reference to {@code view}. Unsubscribe
     * to free this reference.
     * <p>
     * <em>Warning:</em> The created observable uses {@link TickTimer.TickListener} to
     * observe actions. Only one observable can be used for a view at a time.
     *
     * @param view view
     * @return the observable
     */
    @NonNull
    public static Observable<TickTimer> tickTimerUpdates(@NonNull TickTimer view) {
        checkNotNull(view, "view == null");
        return new TickTimerUpdateObservable(view);
    }

    private RxTickTimer() {
        throw new AssertionError("No instances.");
    }
}
